﻿<%@ Page Title="Club Detail" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ClubDetail.aspx.vb" Inherits="WSAD_Assignment.ClubDetail" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .noratingpng
            {
                background-image: url('../Images/norating.png');
                width: 32px;
                height: 32px;
            }

            .ratingpng
            {
                background-image: url('../Images/rating.png');
                width: 32px;
                height: 32px;
            }

            .doneratingpng
            {
                background-image: url('../Images/rating.png');
                width: 32px;
                height: 32px;
            }
       </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="form-signup-heading">Club Profile: <asp:Label ID="lblClubName" runat="server"></asp:Label></h3>

    <asp:UpdatePanel id="upHeaderButtons" runat="server">
        <ContentTemplate>

            <asp:LinkButton ID="btnClubLike" 
                    runat="server"
                    CssClass="btn btn-primary cancel"    
                    CausesValidation="false"      
                    OnClick="btnClubLike_Click">
                    <i aria-hidden="true" class="glyphicon glyphicon-thumbs-up"></i> Like
            </asp:LinkButton>

            <asp:LinkButton ID="btnClubUnlike" 
                    runat="server"
                    CssClass="btn btn-primary cancel"    
                    CausesValidation="false"      
                    OnClick="btnClubUnlike_Click">
                    <i aria-hidden="true" class="glyphicon glyphicon-thumbs-down"></i> Unlike
            </asp:LinkButton>

             <asp:LinkButton ID="btnClubPlayers" 
                    runat="server"
                    CssClass="btn btn-primary cancel"    
                    CausesValidation="false"      
                    OnClick="btnClubPlayers_Click">
                    <i aria-hidden="true" class="glyphicon glyphicon-sort-by-alphabet"></i> Club Players
            </asp:LinkButton>

             <asp:LinkButton ID="btnEditClub" 
                    runat="server"
                    CssClass="btn btn-primary cancel"  
                    CausesValidation="false"        
                    OnClick="btnEditClub_Click">
                    <i aria-hidden="true" class="glyphicon glyphicon-pencil"></i> Edit Club
            </asp:LinkButton>

            <asp:LinkButton ID="btnClubViews" 
                    runat="server"
                    CssClass="btn btn-success"    
                    Enabled="false"
                    CausesValidation="false">
                    <i aria-hidden="true" class="glyphicon glyphicon-eye-open"></i>  <asp:Label ID="lblClubViews" runat="server"></asp:Label> 
            </asp:LinkButton>

             <asp:LinkButton ID="btnBackClubList" 
                    runat="server"
                    CssClass="btn btn-default cancel"    
                    CausesValidation="false"      
                    OnClick="btnBackClubList_Click">
                    <i aria-hidden="true" class="glyphicon glyphicon-arrow-left"></i> Back to Club List
            </asp:LinkButton><br /><br />
    
            <asp:Panel ID="pnlClubLikes" runat="server"><asp:Label ID="lblClubLikes" runat="server"></asp:Label></asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    <br />

    <p>
        <asp:DetailsView ID="dvClubDetail" runat="server" AutoGenerateRows="False" DataSourceID="ClubListDataSource" GridLines="None"
            CssClass="table table-hover table-striped table-bordered table-condensed">
            <Fields>
                <asp:BoundField DataField="ClubName" HeaderText="Name" SortExpression="ClubName" />
                <asp:BoundField DataField="FoundationDate" HeaderText="Foundation Date" SortExpression="FoundationDate" DataFormatString="{0:dd/MM/yyyy}" />
                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                <asp:BoundField DataField="CountryName" HeaderText="Country" SortExpression="CountryName" />
                <asp:ImageField DataImageUrlField="Emblem" HeaderText="Emblem">
                    <ControlStyle Height="100px" Width="100px" />
                </asp:ImageField>
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="ClubListDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ClubsConnectionString %>" ProviderName="<%$ ConnectionStrings:ClubsConnectionString.ProviderName %>" SelectCommand="SELECT [ID], [ClubName], [FoundationDate], [Address], [CountryName], [Emblem] FROM [ClubList] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ClubID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>

    <b><asp:Label ID="lblRateClub" runat="server">Rate this Club!</asp:Label></b><br /><br />
    
    <asp:UpdatePanel id="upClubRatings" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlRating" CssClass="pnlAnonymous" runat="server">
                <b><asp:Label ID="lblRating" runat="server">
                    <asp:LinkButton ID="btnSignIn" 
                        runat="server"
                        CssClass="btn btn-primary btn-sm cancel"    
                        CausesValidation="false"      
                        OnClick="btnSignIn_Click">Sign In
                    </asp:LinkButton>
            
                    or 

                    <asp:LinkButton ID="btnRegister" 
                        runat="server"
                        CssClass="btn btn-success btn-sm cancel"    
                        CausesValidation="false"      
                        OnClick="btnRegister_Click">Register
                    </asp:LinkButton></asp:Label></b>
            </asp:Panel>
    
            <asp:PlaceHolder ID="phRatings" runat="server">
                <asp:Rating ID="RatingForClub" runat="server" AutoPostBack="true" EmptyStarCssClass="noratingpng" 
                            OnChanged="RatingForClub_Changed" FilledStarCssClass="ratingpng" StarCssClass="ratingpng" WaitingStarCssClass="doneratingpng">
                </asp:Rating>
                <br /><br />

                <asp:Label ID="hdnLabel" runat="server"></asp:Label>
            </asp:PlaceHolder>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>


    